<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Promise</title>
    </head>
    <body>
        <script type="module">
            import CP from './CP.js'
            let p = new CP((resolve, reject) => {
                throw new Error('abc')
                // setTimeout(() => resolve('完美'), 1000)
            })
            p.then(value => {
                console.log(value)
                return new CP((resolve, reject) => {
                    resolve('yahoo')
                })
            }).then(value => console.log('success: ' + value))
            // console.log('同步...')
            // setTimeout(() => console.log(p), 2000)
        </script>
    </body>
</html>
